using System;
using UnityEngine;
using UnityEngine.UI;

public class StartManager : MonoBehaviour
{
	public static StartManager Instance;

	public SelectMapManager selectmapMan;

	public GameObject panelMap;

	public bool firstTimePlayGame;

	public FadeScript fadeScipt;

	public Text coinText;

	public static int click;

	private void Awake()
    {
        AdManager.single.ShowBanner();
        click = 0;
		Instance = this;
		BadLogic.pause = false;
		firstTimePlayGame = ((PlayerPrefs.GetInt("FIRSTTIME") == 0) ? true : false);
		if (firstTimePlayGame)
		{
			PlayerPrefs.SetInt("FIRSTTIME", 1);
			CoinManager.coin = 20000000;
			CoinManager.UpCoin();
		}
		else
		{
			CoinManager.GetCoin();
		}
	}

	private void Start()
    {
        AdManager.single.ShowBanner();
        panelMap.SetActive(value: false);
		coinText.text = string.Concat(CoinManager.coin);
	}

	public void clickPlay()
	{
        Action action = () =>
        {
            click = 1;
            panelMap.SetActive(value: true);
        };
        //AdManager.Instance.ShowInterstitial();
        if (!AdManager1.instance.ShieldAddress)
        {
            AdManager.single.ShowNative();
            CheckTouch.Show(action);
        }
        else action();
	}

	public void clickbackMap()
	{
		panelMap.SetActive(value: false);
		Time.timeScale = 1f;
        if (!AdManager1.instance.ShieldAddress) AdManager.single.ShowNative();
    }

	public void clickOption()
	{
	}

	public void clickExit()
	{
	}

	public void exitNo()
	{
	}

	public void exitYes()
	{
		Application.Quit();
	}

	public void Moregame()
	{
		Application.OpenURL("");
	}

	public void Update()
	{
		coinText.text = string.Concat(CoinManager.coin);
	}
}
